//
//  MKPay.h
//  MKPay
//
//  Created by zhuwh on 2017/7/19.
//  Copyright © 2017年 mark. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "MAKPayDefine.h"
#if __has_include(<MAKCommon/MAKSingleton.h>)
#import <MAKCommon/MAKSingleton.h>
#else
#import "MAKSingleton.h"
#endif
#if __has_include(<MAKCommon/MAKMacros.h>)
#import <MAKCommon/MAKMacros.h>
#else
#import "MAKMacros.h"
#endif

@interface MAKPayBase : NSObject

-(void) pay:(id) payInfo scheme:(NSString*)scheme viewController:(UIViewController*)vc callback:(MAKPayCallback)callback;
-(void) handleOpenURL:(NSURL*) url;
-(BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(id) delegate;
-(BOOL)registerWithType:(MAKPayPlatformType)type delegate:(id) delegate appId:(NSString*)appId ;
-(BOOL)unRegisterWithType:(MAKPayPlatformType)type delegate:(id) delegate ;
-(BOOL)registerWithDelegate:(id) delegate entity:(id)entity;
-(BOOL)unRegisterWithDelegate:(id) delegate;
@end

@interface MAKPay : NSObject

//@property(nonatomic,copy) NSString* alipayScheme;
//@property(nonatomic,copy,readonly) NSString* wxAppId;

SingletonH(Manager);

-(MAKPayBase*) create:(MAKPayPlatformType) type;
-(BOOL)registerWithType:(MAKPayPlatformType)type delegate:(id) delegate appId:(NSString*)appId ;
-(BOOL)registerWithType:(MAKPayPlatformType)type delegate:(id) delegate entity:(id)entity;
-(BOOL)unRegisterWithType:(MAKPayPlatformType)type delegate:(id) delegate;

-(void) pay:(id) payInfo type:(MAKPayPlatformType)type scheme:(NSString*)scheme viewController:(UIViewController*)vc callback:(MAKPayCallback)callback;

-(void) handleOpenURL:(NSURL*) url;
-(BOOL)handleOpenUniversalLink:(NSUserActivity *)userActivity delegate:(id) delegate;

@end


